import request from '@/utils/request'

// 户型查询
export function listLayout(query) {
  return request({
    url: '/gcxt/layout/page',
    method: 'get',
    params: query
  })
}

// 户型添加
export function addLayout(data) {
  return request({
    url: '/gcxt/layout/add',
    method: 'post',
    data: data
  })
}

// 户型修改
export function updateLayout(data) {
  return request({
    url: '/gcxt/layout/edit',
    method: 'post',
    data: data
  })
}

// 户型删除
export function delLayout(fids) {
  return request({
    url: '/gcxt/layout/delete',
    method: 'delete',
    data: fids
  })
}

// 户型复制
export function copyLayout(query) {
  return request({
    url: '/gcxt/layout/copyById',
    method: 'get',
    params: query
  })
}

// 图片上传
export function uploadPicture(data) {
  return request({
    url: '/gcxt/checktable/upload',
    method: 'post',
    data: data
  })
}

// 保存绘制部位
export function saveSpace(data) {
  return request({
    url: '/gcxt/layout/saveSpace',
    method: 'post',
    data: data
  })
}
// 清空绘制部位
export function saveSpaceNull(data) {
  return request({
    url: '/gcxt/layout/saveSpace?layoutId='+data,
    method: 'post',
    data: []
  })
}

// 户型绘制查询
export function getLayout(query) {
  return request({
    url: '/gcxt/layout/findOne',
    method: 'get',
    params: query
  })
} 